<template>
  <div class="interestCircle">
    <div class="circleHead">
      <span>兴趣圈</span>
      <span>1.7万人加入></span>
    </div>
    <div class="wrapper" v-if="setShow">
      <div class="content">
        <div v-for="item in $store.state.dataList.circle_list.items" :key="item.id" >
          <img :src="item.img" alt="">
          <p>{{item.title}}</p>
          <em>{{item.description}}</em>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import BScroll from "@better-scroll/core";
import { get } from "@/api/http";
export default {
  computed:{
    setShow(){
      if(this.$store.state.dataList.result==="ok"){
        return true
      }
      return false;
    }
  },
  async created(){
    let res = await get('data/star.json');
    console.log(res.data);
    this.$store.commit("setData",res.data)
  }
};
</script>

<style lang="scss" scoped>
.circleHead {
  display: flex;
  justify-content: space-between;
  span {
    &:first-child {
      font-size: 14px;
      font-weight: 600;
    }
    &:last-child {
      font-size: 12px;
    }
  }
}
.interestCircle{
  background: white;
  border-radius: 5px;
  padding: 20px 5px;
}
.wrapper{
  overflow: hidden;
  margin-top: 30px;
  background: white;
  .content{
    display: flex;
    overflow: auto;
    div{
      width: 99px;
      flex-shrink: 0;
      display:flex;
      flex-direction: column;
      align-items: center;
      img{
        width: 58px;
        display: block;
        border-radius: 50%;
      }
      p{
        font-size: 12px;
        font-weight: 600;
      }
      em{
        font-style: normal;
        font-size: 12px;
        color: rgba(0,0,0,.5);
      }
    }
  }
}
</style>